package com.bbzn.device.client.dao.group;

import com.bbzn.device.client.dataobject.GroupDevice;

import java.util.Date;
import java.util.List;

import com.bbzn.device.client.dto.ct.data.ProductUnionDTO;
import com.bbzn.device.client.dto.group.GroupDeviceDTO;
import com.bbzn.device.client.dto.group.InGroupDTO;
import com.bbzn.device.client.dto.group.OutGroupDTO;
import org.apache.ibatis.annotations.Param;

public interface GroupDeviceMapper {
    /**
     * delete by primary key
     *
     * @param id primaryKey
     * @return deleteCount
     */
    int deleteByPrimaryKey(Long id);

    /**
     * insert record to table
     *
     * @param record the record
     * @return insert count
     */
    int insert(GroupDevice record);

    int insertOrUpdate(GroupDevice record);

    int insertOrUpdateSelective(GroupDevice record);

    /**
     * insert record to table selective
     *
     * @param record the record
     * @return insert count
     */
    int insertSelective(GroupDevice record);

    /**
     * select by primary key
     *
     * @param id primary key
     * @return object by primary key
     */
    GroupDevice selectByPrimaryKey(Long id);

    /**
     * update record selective
     *
     * @param record the updated record
     * @return update count
     */
    int updateByPrimaryKeySelective(GroupDevice record);

    /**
     * update record
     *
     * @param record the updated record
     * @return update count
     */
    int updateByPrimaryKey(GroupDevice record);

    List<GroupDevice> findByAll(GroupDevice groupDevice);

    int deleteByImei(@Param("imei") String imei);

    int updateBatch(List<GroupDevice> list);

    int updateBatchSelective(List<GroupDevice> list);

    int batchInsert(@Param("list") List<GroupDevice> list);

    List<GroupDevice> queryByAll(GroupDeviceDTO group);

    int batchDel(@Param("ids") List<Long> list);

    List<InGroupDTO> getInGroupDevice(@Param("ids") List<Long> ids, @Param("groupId") Long groupId);

    List<String> getInGroupDeviceByImeis(@Param("imeis") List<String> imeis, @Param("groupId") Long groupId);

    String getTopic(@Param("groupId") Long groupId);

    List<OutGroupDTO> getOutGroupDevice(@Param("ids") List<Long> ids);

    ProductUnionDTO getDeviceDetailByImei(@Param("imei") String imei);

    List<ProductUnionDTO> getInGroupDeviceExceptSelf(@Param("imei") String imei, @Param("groupId") Long groupId);

    /**
     * 批量查询
     *
     * @param parameter
     * @return
     */
    List<String> getGroupDeviceList(@Param("list") List<String> parameter);

    List<String> getNbDeviceList(@Param("list") List<String> parameter);

    List<ProductUnionDTO> getProductUnionDTOList(@Param("list") List<String> list);

    /**
     * 批量删除
     *
     * @param ids
     * @return
     */
    int batchDelete(List<Long> ids);
}